﻿using Abp.Domain.Entities.Auditing;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace Hicap.QRCodeWarehouse.Core.Models.DbSet
{
    public class Product : FullAuditedEntity
    {
        public string ProductCode { get; set; }

        [Required]
        public string ProductName { get; set; }

        [Required]
        public string InnerPrefixUrl { get; set; }

        [Required]
        public string OuterPrefixUrl { get; set; }

        public int TotoalInnerCount { get; set; }
        public int TotoalDownloadInnerCount { get; set; }
        public int TotoalUsedInnerCount { get; set; }
        public int TotoalOuterCount { get; set; }
        public int TotoalDownloadOuterCount { get; set; }
        public int TotoalUsedOuterCount { get; set; }

        [Required]
        [ForeignKey("InnerGenerationRule")]
        public int? InnerGenerationRuleId { get; set; }

        public GenerationRule InnerGenerationRule { get; set; }

        [Required]
        [ForeignKey("OuterGenerationRule")]
        public int? OuterGenerationRuleId { get; set; }

        public GenerationRule OuterGenerationRule { get; set; }

        [Required]
        public int SubordinateCompanyId { get; set; }
    }
}